{% extends "sentry/layout_bis.html" %}

{% load i18n %}
{% load sentry_helpers %}
{% load adminmedia %}

{% block title %}BIS &gt; Sentry &gt; index{% endblock %}

{% block breadcrumbs %}
    <div id="breadcrumbs"><a href="../admin/">Home</a> &gt; sentry</div>
{% endblock %}

{% block extrastyle %}
{{ block.super }}
{% endblock %}

{% block pretitle %}
<h2>&nbsp;</h2>
{% endblock %}

{% block content %}
{{ block.super }}
<div id="gavin-others">
    {% paginate message_list from request as message_list per_page 6 %}

    <div id="filters">
        <div class="pulldown-container">
            <div>
            <form method="GET" action="">
                {% for k, v in request.GET.iteritems %}
                    <input type="hidden" name="{{ k }}" value="{{ v }}"/>
                {% endfor %}
                <div class="filter-pulldown" style="display: inline-block; min-width: 245px; width: 20%;"><div class="filter">{% trans "Sort by" %}</div> 
                <select class="filter_choice" name="sort" onchange="this.form.submit()">
                    <option value=""{% ifequal sort 'priority' %} selected="selected"{% endifequal %}>{% trans "Priority" %}</option>
                    <option value="date"{% ifequal sort 'date' %} selected="selected"{% endifequal %}>{% trans "Last Seen" %}</option>
                    <option value="new"{% ifequal sort 'new' %} selected="selected"{% endifequal %}>{% trans "First Seen" %}</option>
                    <option value="freq"{% ifequal sort 'freq' %} selected="selected"{% endifequal %}>{% trans "Frequency" %}</option>
                </select>
                </div>
            </form>
            </div>
            <div style="display: inline; float: right; padding-top: 5px;">
            <!-- PAUSE -->
            {% if has_realtime %}
                <a id="sentry_realtime" class="realtime realtime-pause">Pause Feed</a>
            {% endif %}
            </div>
            <div>
            {{ message_list.paging }}
            </div>
        </div>
    </div>
</div>

<div id="content-main">
    <div style="float:left">
    {% if message_list.objects %}
        <ul class="messages" id="message_list">
            {% for group, priority in message_list.objects|with_priority %}
                {% include "sentry/partial/_group.html" %}
            {% endfor %}
        </ul>
    {% else %}
        <ul class="messages" id="message_list">
            <li class="no-messages" id="no_messages">{% trans "No messages match your filters." %}</li>
        </ul>
    {% endif %}

        <div class="clearfix">
        {{ message_list.paging }}
        </div>
    </div>
    <div id="bissidebar" style="float: right; padding-left: 1em;">
    {% for filter in filters %}
        <div class="sidebar-module sidebar-module-{{ filter.column }}">
            {% if filter.show_label %}
                <h2>{% trans filter.label %}</h2>
            {% endif %}
            <form method="get" action="{{ filter.get_query_string|safe }}">
                {{ filter.render }}
            </form>
        </div>
    {% endfor %}
    </div>
</div>
{% endblock %}
